package be.artesis.titamo.importer;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import be.artesis.titamo.importer.cli.CLInterface;
import be.artesis.titamo.importer.gui.GraphicalInterface;

public class MainExecutable {

	public static void main(String[] args)
	{
		ImporterInterface interf = null;
		if (args.length > 0)
		{
			// Start the textual interface
			interf = new CLInterface(args);
		}
		else
		{
			try {
			    // Set System L&F
		        UIManager.setLookAndFeel(
		            UIManager.getSystemLookAndFeelClassName());
		    } 
		    catch (UnsupportedLookAndFeelException e) {
		       // handle exception
		    }
		    catch (ClassNotFoundException e) {
		       // handle exception
		    }
		    catch (InstantiationException e) {
		       // handle exception
		    }
		    catch (IllegalAccessException e) {
		       // handle exception
		    }
			// Start the graphical interface
			interf = new GraphicalInterface();
		}
		
		interf.run();
	}
}
